package date;

class Date{
    public int year;
    public int month;
    public int day;
    public void printDate(){
        System.out.println("今天是 "+year+"年 "+month+" 月"+day+" 日");
    }
    public void setDate(int year,int month,int day ){
//        year=year;
//        month=month;
//        day=day;   形参名与成员名相同会报错
        this.year=year;
        this.month=month;
        this.day=day;
    }
}
public class 日期 {
    public static void main(String[] args) {
     Date date1=new Date();
     date1.setDate(2008,9,20);
     date1.printDate();
     Date date2=new Date();
     date2.setDate(2010,10,25);
     date2.printDate();
    }
}
